<div class="gap"></div>
<div class="gap"></div>
<div class="gap"></div>
<div class="gap"></div>

<section class="form-step1">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">Update College Information</h3>
                    </div>
                    <div class="panel-body">

                        <?php
                        $form = $this->beginWidget('GxActiveForm', array(
                            'id' => 'checkPassword',
                            'enableAjaxValidation' => false,
                            'htmlOptions' => array('class' => 'form-horizontal')
                        ));
                        ?>               
                        <?php echo $form->errorSummary($model); ?>
                        <div class="form-group" style="<?php echo ($pass == 0) ? '' : 'display: none'; ?>">                   
                            <label class="col-sm-5 control-label" for="">Are you authrised by your college to edit/update collge info? </label>
                            <div class="col-sm-3">
                                <label class="radio-inline">
                                    <input type="radio" class="inlineradio2" name="radio" id="yespassword" placeholder="Password">Yes
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" class="inlineradio3" name="radio" id="Nopassword" placeholder="Password">No
                                </label>
                            </div>

                        </div>

                        <span class="errorMessage" id="sendMail"></span>
                        <div class="PasswordNo" style="<?php echo ($pass == 1) ? '' : 'display: none'; ?>">  
                            <div class="gap"></div>

                            <div class="clearfix"></div>
                            <div class="clearfix"></div>
                            <div class="clearfix"></div>
                            <div class="form-group">
                                <div class="col-sm-3 control-label"><?php echo $form->labelEx($model, 'What is your name'); ?>
                                </div>
                                <div class="col-sm-4"><?php echo $form->textField($model, 'name_of_the_head_institution', array('maxlength' => 105, 'class' => 'form-control')); ?>
                                    <?php echo $form->error($model, 'name_of_the_head_institution'); ?>
                                </div><!-- row -->
                            </div>
                            <div class="clearfix"></div>


                            <div class="clearfix"></div>
                            <div class="form-group">
                                <div class="col-sm-3 control-label"><?php echo $form->labelEx($model, 'What is your email'); ?>
                                </div>
                                <div class="col-sm-4"><?php echo $form->textField($model, 'college_email', array('maxlength' => 105, 'class' => 'form-control')); ?>
                                    <?php echo $form->error($model, 'college_email'); ?>
                                </div><!-- row -->
                            </div>
                            <div class="form-group">
                                <div class="col-sm-3 control-label"><?php echo $form->labelEx($model, 'What is your phone number'); ?>
                                </div>
                                <div class="col-sm-4">
                                    <div class="input-group">
<!--                                        <span class="input-group-addon">+91</span>-->
                                        <?php echo $form->textField($model, 'phone_number', array('maxlength' => 105, 'class' => 'form-control')); ?>
                                    </div>
                                    <?php echo $form->error($model, 'phone_number'); ?>
                                </div><!-- row -->
                            </div>
                            <div class="form-group">
                                <div class="col-sm-3 control-label">&nbsp;
                                </div>
                                <div class="col-sm-4">
                                    <div class="input-group">
                                        <?php echo GxHtml::submitButton(Yii::t('app', 'Save'), array('class' => 'read-more ', 'style' => 'width:100%;')); ?>
                                    </div>

                                </div><!-- row -->
                            </div>
                            <div class="clearfix"></div>

                        </div><div class="clearfix"></div>

                        <div class="clearfix"></div>

                        <?php
                        $this->endWidget();
                        ?>
                    </div>

 </div> </div> </div> </div>


                    </section>
                    <div class="gap"></div>
                    <div class="gap"></div>  
                    <script>
                        jQuery(document).ready(function() {
                            jQuery('input:radio').change(function() {
                                if (jQuery(this).attr('id') == 'yespassword') {
                                    jQuery("#sendMail").hide();
                                    jQuery(".passwordYes").hide();
                                    jQuery(".PasswordNo").show();
                                } else {
                                    window.location = '<?php echo Yii::app()->createAbsoluteUrl('site/index') ?>';
                                }
                            });
                        })


                        function sendmail() {
                            jQuery.ajax({
                                url: "<?php echo CController::createUrl('College/UpdateCollgeInfor') ?>",
                                type: "POST",
                                data: jQuery("#checkPassword").serialize(),
                                success: function(data, textStatus, jqXHR) {
                                    jQuery("#sendMail").show();
                                    jQuery("#sendMail").html(data);
                                    jQuery(".PasswordNo").hide();

                                },
                            });
                        }

                    </script>